﻿using System;
using System.Globalization;
using System.Windows;

namespace vBridge.Wpf.ValueConverters
{
    /// <summary>
    /// Converts a boolean to a visibility value.
    /// </summary>
    public sealed class BooleanToHiddenVisibilityValueConverter : ValueConverterBase<Boolean, Visibility>
    {
        protected override Visibility SourceToDestination(Boolean value, Type targetType, Object parameter, CultureInfo culture)
        {
            return value ? Visibility.Visible : Visibility.Hidden;
        }

        protected override Boolean DestinationToSource(Visibility value, Type targetType, Object parameter, CultureInfo culture)
        {
            return value != Visibility.Hidden;
        }
    }
}